/**
 * 	write on 2005-10-26 12:45:30.
 */
package org.nanhill.xmlro.gsp.packet;

/**
 * @author alin
 * 
 */
/**
 * @author alin
 * 
 */
public class RequestPacket<E> extends AbstractPacket<E> {
	protected String command = "";

	public String getCommand() {
		return command;
	}

	public void setCommand(String code) {
		this.command = code;
	}

	public RequestPacket() {
	}

	public RequestPacket(String commond, E body) {
		this.command = commond;
		this.body = body;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.nanhill.protocol.gsp.type.packet.GspPacket#getStartTag()
	 */
	public void appendBeginTag(StringBuilder builder) {
		builder.append("<Req id=\"");
		builder.append(this.id);
		builder.append("\" cmd=\"");
		builder.append(this.command);
		builder.append("\">");
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.nanhill.protocol.gsp.type.packet.GspPacket#getEndTag()
	 */
	public void appendEndTag(StringBuilder builder) {
		builder.append("</Req>");
	}

}
